const mysql = require('mysql')
const con = mysql.createConnection({
    host:"127.0.0.1",
    port:"3306",    
    user:"root",
    password:"123456",
    database:"myblog"
})

//开始链接
con.connect()
const sql ="select * from blogs"
con.query(sql,(err,data)=>{
    console.log(data);
})